package com.foreverwin.mes.so.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.so.model.RecipeParam;
import com.foreverwin.mes.so.mapper.RecipeParamMapper;
import com.foreverwin.mes.so.service.RecipeParamService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Syngna
 * @since 2020-02-04
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class RecipeParamServiceImpl extends ServiceImpl<RecipeParamMapper, RecipeParam> implements RecipeParamService {


    @Autowired
    private RecipeParamMapper recipeParamMapper;

    @Override
    public Page<RecipeParam> selectPage(FrontPage<RecipeParam> frontPage, RecipeParam recipeParam) {
        EntityWrapper<RecipeParam> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(recipeParam);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<RecipeParam> selectList(RecipeParam recipeParam) {
        EntityWrapper<RecipeParam> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(recipeParam);
        return super.selectList(queryWrapper);
    }


}